
const useDemoState = defineStore(
  'demo',
  {
    state: () => ({
      initDataList:[],
      columns:[
        {label:"系统时间", value:"data0", width:100},
        {label:"Speed1", value:"data1"},
        {label:"Speed2", value:"data2"},
        {label:"Torque1", value:"data3"},
        {label:"Torque2", value:"data4"},
        {label:"Pm1", value:"data5"},
        {label:"Pm2", value:"data6"},
        {label:"控制器温度[℃]", value:"data7"},
        {label:"电机温度[℃]", value:"data8"},
        {label:"电机油温[℃]", value:"data9"},
        {label:"出水温度[℃]", value:"data10"},
        {label:"出水流量[1/min]", value:"data11"},
        {label:"回水温度[℃]", value:"data12"},
        {label:"输出电压[V]", value:"data13"},
        {label:"输出电流[A]", value:"data14"},
        {label:"RT_转矩偏差[Nm]", value:"data15"},
        {label:"扭矩和[Nm]", value:"data16"},
        {label:"Udc[V]", value:"data17"},
        {label:"Idc[A]", value:"data18"},
        {label:"输入电功率[kW]", value:"data19"},
        {label:"Spd[r/min]", value:"data20"},
        {label:"Tq[Nm]", value:"data21"},
        {label:"机械功率[kW]", value:"data22"},
        {label:"效率[%]", value:"data23"}
      ]
    }),
    getters: {
      getInitDataList: (state) => {
        const data = localStorage.getItem('initDataList');
        state.initDataList = data ? JSON.parse(data) : [];
        return state.initDataList;
      }
    },
    actions: {
      setInitDataList(data) {
        this.initDataList = data;
        localStorage.setItem('initDataList', JSON.stringify(data))
      }
    },
  })

export default useDemoState
